unit ctrl;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, jpeg, StdCtrls, GIFImage, IncludeFile, RzLabel;

type
  TCtrlFrame = class(TFrame)
    F101: TPanel;
    Image1: TImage;
    F105: TPanel;
    Image2: TImage;
    F104: TPanel;
    Image3: TImage;
    F103: TPanel;
    Image4: TImage;
    F102: TPanel;
    Image5: TImage;
    labgrp_system: TLabel;
    labgrp_data: TLabel;
    labgrp_manager: TLabel;
    labgrp_qualityctrl: TLabel;
    labgrp_help: TLabel;
    P101: TPanel;
    P105: TPanel;
    P104: TPanel;
    P103: TPanel;
    p102: TPanel;
    Image6: TImage;
    Image7: TImage;
    Image8: TImage;
    Image9: TImage;
    Image12: TImage;
    Image18: TImage;
    Image19: TImage;
    labmenu_logout: TLabel;
    labmenu_usermanage: TLabel;
    labmenu_sysset: TLabel;
    labmenu_cmprsrpr: TLabel;
    labmenu_wtlogger: TLabel;
    labmenu_abut: TLabel;
    labmenu_help: TLabel;
    F106: TPanel;
    Image11: TImage;
    labgrp_communtication: TLabel;
    P106: TPanel;
    Image20: TImage;
    labmenu_clntrpt: TLabel;
    Image14: TImage;
    labmenu_picmanage: TLabel;
    labmenu_employee: TLabel;
    Image15: TImage;
    Image16: TImage;
    labmenu_client: TLabel;
    Image17: TImage;
    labmenu_production: TLabel;
    Image22: TImage;
    labmenu_rlvideo: TLabel;
    Image10: TImage;
    Label1: TLabel;
    Image24: TImage;
    Label2: TLabel;
    Image13: TImage;
    labaddr1: TLabel;
    labaddr2: TLabel;
    labaddr3: TLabel;
    labtel: TLabel;
    labfax: TLabel;
    laburl: TLabel;
    labcmpyname: TLabel;
    Image21: TImage;
    Label3: TLabel;
    labmenu_barGrap: TLabel;
    Image23: TImage;
    Image25: TImage;
    labmenu_scalecheck: TLabel;
    procedure MouseEnter(Sender:TObject);
    Procedure MouseLeave(Sender:TObject);
    Procedure CtrlLablesClick(Sender:TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure IniLanguage;
  end;

implementation

{$R *.dfm}

procedure TCtrlFrame.IniLanguage;
var
  I:integer;
begin
  for I:=0 to ComponentCount-1 do begin
    if Components[I] is TLabel then begin
      if 0<>TLabel(Components[I]).Tag then
        TLabel(Components[I]).Caption:=
                GetCaption(name,TLabel(Components[I]).Tag);
    end;
  end;
end;

procedure TCtrlFrame.MouseEnter(Sender:TObject);
begin
  with Tlabel(Sender).Font do begin
    Color:=clActiveCaption;
    Style:=Style+[fsUnderline];
  end;
end;

Procedure TCtrlFrame.MouseLeave(Sender:TObject);
begin
  with Tlabel(Sender).Font do begin
    Color:=clNavy;
    Style:=Style-[fsUnderline];
  end;
end;

Procedure TCtrlFrame.CtrlLablesClick(Sender:TObject);
begin
  Case TLabel(Sender).Tag of
    101:begin
      if P101.Visible then begin             
        P101.hide;
      end else begin
        P101.Top :=F101.Top +F101.Height;
        P101.Show; 
      end;
    end;
    105:begin
      if P105.Visible then begin
        P105.Hide;
      end else begin
        P105.Top :=F105.Top +F105.Height;
        P105.Show;
      end;
    end;
    102:begin
      if P102.Visible then begin
        P102.Hide;
      end else begin
        P102.Top :=F102.Top +F102.Height;
        P102.Show;
      end;
    end;
    103:begin
      if P103.Visible then begin
        P103.Hide;
      end else begin
        P103.Top :=F103.Top +F103.Height;
        P103.Show;
      end;
    end;
    104:begin
      if P104.Visible then begin
        P104.Hide;
      end else begin
        P104.Top :=F104.Top +F104.Height;
        P104.Show;
      end;
    end;
    106:begin
      if P106.Visible then begin
        P106.Hide;
      end else begin
        P106.Top :=F106.Top +F106.Height;
        P106.Show;
      end;
    end;
  end;
end;

end.
